﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YasharEl.Infrastructure.EntityModel;
using System.Runtime.Serialization;

namespace YasharEl.Infrastructure.Core.Prototype
{
    [Serializable]
    public class PropertyResolutionException : DomainModelException
    {
        #region Fields

        private readonly string _propertyName;
        private readonly Type _entityType;

        #endregion

        #region Getters

        public string PropertyName
        {
            get { return _propertyName; }
        }

        public Type EntityType
        {
            get { return _entityType; }
        }

        #endregion

        #region Constructors

        public PropertyResolutionException(string propertyName, Type entityType)
            : base(string.Format("Could not resolve property {0} of entity {1}.", propertyName, entityType))
        {
            _propertyName = propertyName;
            _entityType = entityType;
        }

        protected PropertyResolutionException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        #endregion
    }
}
